package mapper;

import com.lagou.entity.CourseComment;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public interface CourseCommentDao {

    //保存留言
    Integer saveComment(CourseComment courseComment);

    //分页查询留言
    List<CourseComment> getCommentByCourseId(@Param("courseid")Integer courseid,
                                             @Param("offset")Integer offset,
                                             @Param("pageSize")Integer pageSize);
    //查看是否点过赞
    Integer existsFavorite(@Param ("cid")Integer comment_id,@Param ("uid")Integer user_id);

    //保存赞
    Integer saveCommentFavorite(@Param("cid")Integer comment_id,@Param("uid")Integer userid);

    //更新点赞的状态
    Integer updateFavoriteStatus(@Param ("x")Integer x,@Param("cid")Integer comment_id,@Param("uid")Integer userid);

    //更新点赞的数量
    Integer updateLikeCount(@Param ("x")Integer x,@Param("cid")Integer comment_id);
}
